<template>
  <div class="app-container">
    <el-form :model="queryParams"  ref="queryForm" size="small" :inline="true" v-show="showSearch" >
      <el-form-item label="手机号" prop="mobile">
        <el-input v-model="queryParams.mobile" placeholder="手机号" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="用户名称" prop="nickName">
        <el-input v-model="queryParams.nickName" placeholder="用户名称" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery" >搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-table v-loading="loading" :data="dataList">
      <el-table-column label="序号" align="center" type="index" />
      <el-table-column label="昵称" align="center" prop="nick_name" min-width="120" />
      <el-table-column label="用户id" align="center" prop="user_id" min-width="120" />
      <el-table-column label="手机号" align="center" prop="mobile" min-width="120" />
      <el-table-column label="团队总人数" align="center" prop="team" min-width="120" />
      <el-table-column label="团队业绩" align="center" prop="groupPerformance" min-width="120" />
      <el-table-column label="直推服务商" align="center" prop="directThrust" min-width="120" />
      <el-table-column label="特级" align="center" prop="specialGrade" min-width="120" />
      <el-table-column label="高级" align="center" prop="advanced" min-width="120" />
      <el-table-column label="中级" align="center" prop="middleRank" min-width="120" />
      <el-table-column label="初级" align="center" prop="primary" min-width="120" />
    </el-table>

    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNo"
      :limit.sync="queryParams.pageSize"
      @pagination="getList" />

  </div>
</template>

<script>
import { getDataList} from "@/api/financialManagement/teamPerformance";
export default {
  name: "productCate",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 订单表格数据
      dataList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        mobile:null,
        nickName:null,
        pageNo: 1,
        pageSize: 10
      },
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询列表 */
    getList() {
      this.loading = true;
      getDataList(this.queryParams).then((response) => {
        if(response.code == 200){
          this.dataList = JSON.parse(JSON.stringify(response.data));
          this.total = response.extend.total;
          this.loading = false;
        }
      });
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNo = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    
  },
};
</script>
<style>
.el-input.is-disabled .el-input__inner{
  color: #606266;
}
</style>
